I. Viewing an attacker's IPawk ' {print $} ' Cut Sort Uniq Sort -NTwo. Installing the DDoS deflate#wget http:// // download DDoS deflate#chmod0700 Install. SH // Add permissions #./install. SH // ExecutionThree. Configuring DDoS deflateThe following is the default configuration of the DDoS deflate in/usr/local/
Mitigating DDoS attacks
#防止SYN攻击, lightweight prevention
Iptables-n Syn-floodIptables-a input-p tcp–syn-j Syn-floodIptables-i syn-flood-p tcp-m limit–limit 3/s–limit-burst 6-j returnIptables-a syn-flood-j REJECT
#防止DOS太多连接进来, you can allow the external network card to each IP up to 15 initial connections, over the discarded
Iptables-a input-i eth0-p tcp–syn-m
In IDCs, hardware firewalls are usually used to prevent DDOS and CC attacks. IPtables can provide good protection for a small amount of attacks. 1. firewall enabling/disabling in Linux Command 1) permanently effective. it will not be enabled after restart: chkconfigiptableson disabled: chkconfigiptablesoff2) effective immediately, in IDCs, hardware firewalls are usually used to prevent
The main 2 basic practical applications, mainly related to the ban Ping (IPv4) and the prohibition of UDP, that is, the use of the server to prevent hackers to outsource DDoS attack content.
First, if there is no iptables prohibit ping
echo 1 >/proc/sys/net/ipv4/icmp_echo_igore_all #开启echo 0 >/proc/sys/net/ipv4/icmp_echo_igore_all #关闭Second, the use of iptables
Detailed description of Linux iptables firewall + anti-DDOS policy configuration
The network firewall function has been implemented in the Linux kernel for a long time. In different Linux kernel versions, different software is used to implement the firewall function.In the 2.0 kernel, the firewall tool is ipfwadm.In the 2.2 kernel, the firewall tool is ipchains.For kernels later than 2.4, the firewall opera
Detailed description of Linux iptables firewall + anti-DDOS policy configuration
650) this. width = 650; "alt =" "border =" 0 "src =" http://www.bkjia.com/uploads/allimg/131227/0T2502549-0.jpg "/>
The network firewall function has been implemented in the Linux kernel for a long time. In different Linux kernel versions, different software is used to implement the firewall function.In the 2.0 kernel, the fire
An example of iptables anti-DDoS method
Mitigating DDoS attacks#防止SYN攻击, lightweight prevention
Iptables-n Syn-floodIptables-a input-p tcp–syn-j Syn-floodIptables-i syn-flood-p tcp-m limit–limit 3/s–limit-burst 6-j returnIptables-a syn-flood-j REJECT
#防止DOS太多连接进来, you can allow the external network card to each IP u
Defense against DDOS attacks # lightweight prevention of SYN Attacks iptables-N syn-flood iptables-a input-p tcp -- syn-j syn-flood iptables-I syn-flood-p tcp- m limit -- limit 3/s -- limit-burst 6-j RETURN iptables-A syn-flood-j REJECT # prevent too many DOS connections, ea
Recently a period of time php-ddos flooding, a period of time before the VPS was hackers hanging horse, a few months of traffic ran hundreds of G, a bit of doubt is being used to php-ddos, so today reinstall the VPS system and reconfigure the environment.Under the use of Iptables, from the root causes of the ban on Php-ddos
Anti-DDoS script
# Lightweight prevention against SYN AttacksIptables-N syn-floodIptables-A input-p tcp-syn-J syn-floodIptables-I syn-flood-P TCP-m limit-limit 3/s-limit-burst 6-J returnIptables-a syn-flood-J reject
# Prevent too many Dos connections. You can allow up to 15 Initial connections from each IP address of the Internet Nic, exceeding the limit of discardingIptables-A input-I eth0-P TCP-syn-M connlimit-abve 15-J DropIptables-A input-p tcp-M
The main 2 basic practical applications, mainly related to the ban Ping (IPv4) and the prohibition of UDP, that is, the use of the server to prevent hackers to outsource DDoS attack content.
First, if there is no iptables prohibit ping
echo 1 >/proc/sys/net/ipv4/icmp_echo_igore_all #开启echo 0 >/proc/sys/net/ipv4/icmp_echo_igore_all #关闭
Second, the iptables to p
This article introduces how Iptables limits the number of connections of the same IP address in linux to prevent CC/DDOS attacks. This is only the most basic method. If the attack is real, we still need hardware compaction to prevent it.
1. Set the maximum number of connections to port 80 to 10, which can be customized.
The Code is as follows:
Copy code
Mitigating DDoS attacks#防止SYN攻击, lightweight preventionIptables-n Syn-floodIptables-a input-p tcp–syn-j Syn-floodIptables-i syn-flood-p tcp-m limit–limit 3/s–limit-burst 6-j returnIptables-a syn-flood-j REJECT
#防止DOS太多连接进来, you can allow the external network card to each IP up to 15 initial connections, over the discardedIptables-a input-i eth0-p tcp–syn-m connlimit–connlimit-above 15-j DROPIptables-a input-p tcp-m state–state established,related-j
1. Limit the number of IP connections to 80 ports to a maximum of 10, which can be customized.
The code is as follows
Copy Code
Iptables-i input-p TCP--dport 80-m connlimit--connlimit-above 10-j DROP
2. Use the recent module to limit the number of new requests in the same IP time, recent more features please refer to: Iptables Module recent application.
1. Limit the maximum number of IP connections to a 80-port connection to 10, which can be customized to modify.
The code is as follows
Copy Code
Iptables-i input-p TCP--dport 80-m connlimit--connlimit-above DROP
2. Use the recent module to limit the number of new requests connected to the same IP time, recent more features please refer to: Iptables Module recent applic
CC attack a bit siege feeling, the correct setting of protection rules can be done in a very unstable, here gives a iptables IP connection frequency and concurrency restrictions, limit the single IP connection and frequency of the set rules introduced
#单个IP在60秒内只允许新建20个连接, this assumes that the Web port is 80,
Copy Code code as follows:
Iptables-i input-i eth1-p tcp-m tcp–dport 80-m state–st
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.